package com.zjxny.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.zjxny.proxy.CustomerProxy;

import lombok.Getter;
import lombok.Setter;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_erupt.Power;
import xyz.erupt.annotation.sub_erupt.Tree;
import xyz.erupt.annotation.sub_field.Edit;
import xyz.erupt.annotation.sub_field.EditType;
import xyz.erupt.annotation.sub_field.View;
import xyz.erupt.annotation.sub_field.sub_edit.BoolType;
import xyz.erupt.annotation.sub_field.sub_edit.Search;
import xyz.erupt.upms.model.base.HyperModel;
import java.util.Date;
@Setter
@Getter
@Entity
@Table(name = "customer_info")
@Erupt(
		name = "客户信息"
		,tree = @Tree(id = "id", label = "title",pid = "parent.id")
		,power = @Power(add = true, delete = false, 
        edit = true, query = true, 
        importable = true, export = true)
		,dataProxy = CustomerProxy.class
)
public class CustomerInfo extends HyperModel{
	
	private static final long serialVersionUID = 7866407284129139047L;

	@EruptField(
			views = @View(title = "姓名")
			,edit = @Edit(
					title="姓名"
					,type = EditType.INPUT
					,notNull = true
					,search = @Search(vague = true)
				)
	)
	private String userName;
	
	@EruptField(
			views = @View(title = "手机号码")
			,edit = @Edit(
					title="手机号码"
					,type = EditType.INPUT
					,notNull = true
				)
	)
	@Column(name = "phone_no", columnDefinition="char(11)")
	private String phoneNo;
	
	@EruptField(
			views = @View(title = "车牌号码")
			,edit = @Edit(
					title="车牌号码"
					,type = EditType.INPUT
					,search = @Search(vague = true)
				)
	)
	private String carNo;

	@EruptField(
			views = @View(title = "商业险到期时间")
			,edit = @Edit(
			title="商业险到期时间"
			,type = EditType.DATE
			,search = @Search(vague = true)
	)
	)
	@Column(name = "compulsory_insurance_date", columnDefinition="date")
	private Date compulsoryInsuranceDate;

	@EruptField(
			views = @View(title = "商业险到期时间")
			,edit = @Edit(
			title="商业险到期时间"
			,type = EditType.DATE
			,search = @Search(vague = true)
		)
	)
	@Column(name = "biz_insurance_date", columnDefinition="date")
	private Date bizInsuranceDate;
	
	@EruptField(
			views = @View(title = "有效")
			, edit = @Edit(
                    title = "有效",
                    type = EditType.BOOLEAN
                    ,search = @Search,
                    boolType = @BoolType
            )
	)
	private Boolean isValid=true;
}